'use strict';
var webpack = require('webpack');
var path = require('path');

module.exports = {
    entry: './src/index',
    output: {
        path: path.join(__dirname, '/js'),
        filename: 'index.js',
        publicPath: '/js/'
    },
    resolve: {
        extensions: ['', '.js']
    },
    module: {
        loaders: [
            {
                test: /.js?$/,
                loader: 'babel-loader',
                exclude: /node_modules/,
                query: {
                    presets: ['es2015', 'react']
                }
            }
        ]
    },
    plugins: [
        new webpack.ProvidePlugin({
            $: "jquery",
            jQuery: "jquery",
            "window.jQuery": "jquery"
        }),
        new webpack.DefinePlugin({
            //'process.env.NODE_ENV': '"development"',
            'process.env.NODE_ENV': '"development"',
            __DEBUG__: JSON.stringify('false')
        })
        //,
        //new webpack.optimize.UglifyJsPlugin({
        //    mangle: {
        //        //except: ['$', 'exports', 'require']
        //    }
        //})
    ],
    clearBeforeBuild: true
};